import { _decorator, Component, Label } from 'cc';
import { Battle } from '../Battle';
import { PlayerEnergyManager } from '../Player/PlayerEnergyManager';
const { ccclass, property } = _decorator;

@ccclass('EnergyPanel')
export class EnergyPanel extends Component {

    @property(Label)
    private energy1Label: Label = null;
    @property(Label)
    private energy2Label: Label = null;


    start() {

    }

    update(deltaTime: number) {
        const playerEnergy = Battle.playerNode.getComponent(PlayerEnergyManager);
        if (playerEnergy) {
            this.energy1Label.string = playerEnergy.GetEnergyNumByType(1).toString();
            this.energy2Label.string = playerEnergy.GetEnergyNumByType(2).toString();
        }
    }
}


